package com.ruoyi.dgdData.service.impl;

import java.util.List;
import java.util.concurrent.Future;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.dgdData.domain.plat.DataDgdHshl;
import com.ruoyi.dgdData.mapper.DataDgdHshlMapper;
import com.ruoyi.dgdData.service.IDataDgdHshlService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.AsyncResult;
import org.springframework.stereotype.Service;


/**
 * 单轨吊回绳轮预张紧力测试Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-12-28
 */
@Service
public class DataDgdHshlServiceImpl implements IDataDgdHshlService
{
    @Autowired(required = false)
    private DataDgdHshlMapper dataDgdHshlMapper;

    /**
     * 查询单轨吊回绳轮预张紧力测试
     * 
     * @param hshId 单轨吊回绳轮预张紧力测试主键
     * @return 单轨吊回绳轮预张紧力测试
     */
    @Override
    public DataDgdHshl selectDataDgdHshlByHshId(Long hshId)
    {
        return dataDgdHshlMapper.selectDataDgdHshlByHshId(hshId);
    }

    /**
     * 查询单轨吊回绳轮预张紧力测试
     *
     * @param dataTaskId
     * @return 单轨吊回绳轮预张紧力测试
     */
    @Override
    public Future<List<DataDgdHshl>> selectDataDgdHshlByDataTaskId(Long dataTaskId) {
        return new AsyncResult<>(dataDgdHshlMapper.selectDataDgdHshlByDataTaskId(dataTaskId));
    }

    /**
     * 查询单轨吊回绳轮预张紧力测试列表
     * 
     * @param dataDgdHshl 单轨吊回绳轮预张紧力测试
     * @return 单轨吊回绳轮预张紧力测试
     */
    @Override
    public List<DataDgdHshl> selectDataDgdHshlList(DataDgdHshl dataDgdHshl)
    {
        return dataDgdHshlMapper.selectDataDgdHshlList(dataDgdHshl);
    }

    /**
     * 新增单轨吊回绳轮预张紧力测试
     * 
     * @param dataDgdHshl 单轨吊回绳轮预张紧力测试
     * @return 结果
     */
    @Override
    public int insertDataDgdHshl(DataDgdHshl dataDgdHshl)
    {
        dataDgdHshl.setCreateTime(DateUtils.getNowDate());
        return dataDgdHshlMapper.insertDataDgdHshl(dataDgdHshl);
    }

    /**
     * 批量新增单轨吊回升轮张紧力
     *
     * @param dataDgdHshls
     */
    @Override
    public int batchDataDgdHshl(List<DataDgdHshl> dataDgdHshls) {
        return dataDgdHshlMapper.batchDataDgdHshl(dataDgdHshls);
    }

    /**
     * 修改单轨吊回绳轮预张紧力测试
     * 
     * @param dataDgdHshl 单轨吊回绳轮预张紧力测试
     * @return 结果
     */
    @Override
    public int updateDataDgdHshl(DataDgdHshl dataDgdHshl)
    {
        dataDgdHshl.setUpdateTime(DateUtils.getNowDate());
        return dataDgdHshlMapper.updateDataDgdHshl(dataDgdHshl);
    }

    /**
     * 变更单轨吊回绳轮预张紧力数据状态为2
     *
     * @param hshId 单轨吊回绳轮预张紧力数据主键
     * @return 结果
     */
    @Override
    public int updateDataDgdHshlByHshId(Long hshId) {
        return dataDgdHshlMapper.updateDataDgdHshlByHshId(hshId);
    }

    /**
     * 变更单轨吊回绳轮预张紧力数据状态为2
     *
     * @param dataTaskId
     * @return 结果
     */
    @Override
    public int updateDataDgdHshlByDataTaskId(Long dataTaskId) {
        return dataDgdHshlMapper.updateDataDgdHshlByDataTaskId(dataTaskId);
    }

    /**
     * 批量删除单轨吊回绳轮预张紧力测试
     * 
     * @param hshIds 需要删除的单轨吊回绳轮预张紧力测试主键
     * @return 结果
     */
    @Override
    public int deleteDataDgdHshlByHshIds(Long[] hshIds)
    {
        return dataDgdHshlMapper.deleteDataDgdHshlByHshIds(hshIds);
    }

    /**
     * 删除单轨吊回绳轮预张紧力测试信息
     * 
     * @param hshId 单轨吊回绳轮预张紧力测试主键
     * @return 结果
     */
    @Override
    public int deleteDataDgdHshlByHshId(Long hshId)
    {
        return dataDgdHshlMapper.deleteDataDgdHshlByHshId(hshId);
    }
}
